<!DOCTYPE HTML>
<style>
.test1 {
    width: 1px; 
    width: calc(100px
</style>
<style>
.test2 {
    width: 1px;
    width: calc((((((100px
</style>
<style>
@media all {
.test3 {
    width: 1px;
    width: calc(100px
</style>
<body>
<div>Tests parsing style declarations without closing braces and parentheses. &quot;User agents must close all open constructs ... at the end of the style sheet.&quot;
(<a href="http://www.w3.org/TR/CSS21/syndata.html#parsing-errors">http://www.w3.org/TR/CSS21/syndata.html#parsing-errors</a>). So it must be parsed as if
all braces and parentheses are closed.</div>
<div id="console"></div>
<script>
if (window.testRunner)
    testRunner.dumpAsText();

var NUMBER_OF_TESTS = 3;
var failed = false;
var consoleElement = document.getElementById("console");
for (var i = 1; i <= NUMBER_OF_TESTS; i++) {
    var div = document.createElement("DIV");
    div.className = "test" + i;
    document.body.appendChild(div);
    var width = window.getComputedStyle(div).getPropertyValue("width");
    document.body.removeChild;

    if (width != "100px") {
        consoleElement.textContent += "Test " + i + " failed\n";
        failed = true;
    }
}
if (!failed) {
    consoleElement.textContent += "All tests passed\n";
}
</script>
</body>
